package com.yuexunxinxi.carefree.utils;

import com.yuexunxinxi.carefree.entity.AUser;

/**
 * 作者: 李咨辰
 * 文件名: UserThreadLocal.java
 * 路径: com.xltz.web.utils
 * 时间: 2024-09-20 11:34
 * 版本: 1.0
 * 描述: TODO 储存user信息
 **/
public class AUsertThreadLocal {
    private AUsertThreadLocal() {
    }

    //线程变量隔离
    private static final ThreadLocal<AUser> LOCAL = new ThreadLocal<>();

    public static void put(AUser aUser) {
        LOCAL.set(aUser);
    }

    public static AUser get() {
        return LOCAL.get();
    }

    public static void remove() {
        LOCAL.remove();
    }
}
